﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace qdata
{
    public  class SiteData
    {
        private static volatile SiteData m_instance = null;

        public static SiteData GetInstance()
        {
            if (m_instance == null)
            {
                lock (typeof(SiteData))
                {
                    if (m_instance == null)
                    {

                        m_instance = new SiteData();
                    }
                }
            }
            return m_instance;
        }

        public string GetOtherInfo(string site)
        {
            string temp = string.Empty;
            string jttemp = TotalData.GetInstance().ReaFile("ReplyInfo.txt");
            string sql2 = "select * from [Site] where Name='" + site + "'";
            DataTable dt = Common.GetInstance().ExecuteDataTable(sql2);
            if (dt == null || dt.Rows.Count <= 0) return string.Empty;
            Random ra=new Random(unchecked((int)DateTime.Now.Ticks));
            int irow=ra.Next(0,dt.Rows.Count );
            temp = TotalData.GetInstance().ChangeTempData(dt.Rows[irow], jttemp);
            return temp;

        }
        

    }
}
